# coding=utf-8
from django.db import models

# Create your models here.

class Book(models.Model):
    """书籍类"""
    title = models.CharField(max_length=8)

    def __str__(self):
    	return "%d" % self.pk

    pass

class Hero(models.Model):
    """人物类"""
    name = models.CharField(max_length=8)
    book = models.ForeignKey("Book", on_delete=models.CASCADE)
    
    def __str__(self):
    	return "%d" % self.pk

    pass
